<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/web/header.jsp"%>
<title>项目信息添加</title>
</head>
<body>
<fieldset class="layui-elem-field" style="margin: 25px;">
		<legend>信息维护-添加信息</legend>
		<div class="layui-field-box">
			<form class="layui-form" method="post">
				<div class="layui-form-item">
					<label class="layui-form-label">项目编号</label>
					<div class="layui-input-block">
						<input type="text" name="code" lay-verify="required"
							style="width: 200px;" placeholder="请输入项目编号" autocomplete="off"
							class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">项目名称</label>
					<div class="layui-input-block">
						<input type="text" name="name" lay-verify="required"
							style="width: 200px;" placeholder="请输入项目名称" autocomplete="off"
							class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">项目时间</label>
					<div class="layui-input-block">
						<input type="text" id="date" name="date" lay-verify="required"
							style="width: 200px;"  autocomplete="off"
							class="layui-input">
					</div>
				</div>
			
				<div style="width: 68%; margin: auto;">
					<div class="layui-input-inline" >
						<input type="button" class="layui-btn"  lay-submit
							lay-filter="add" value="确定">
					</div>
					<div class="layui-input-inline">
						<input type="button" class="layui-btn" onclick="closeThis()"
							value="取消">
					</div>
					<div class="layui-input-inline">
						<input type="reset" class="layui-btn layui-btn-primary">
					</div>
				</div>
				<input type="hidden" name="action" value="add">
			</form>
		</div>

	</fieldset>
	<script type="text/javascript">
	renderDate("date",new Date());
	form.render();
// 	function renderDate(id) {
// 		laydate.render({
// 			elem: "#" + id,
// 			type: "date",
// 			value: new Date()
// 		})
// 	}
	formSubmit("/project","submit(add)","text",function(data){
		console.log(data)
		if(data==1){
			layer.msg("添加成功",{time:1500},closeThis)
		}else if(data=="repeat"){
			layer.msg("添加失败,项目编号已占用")
		}else{
			layer.msg("添加失败")
		}
	})
	</script>
</body>
</html>